package main

import (
	"github.com/tealeg/xlsx"
)

func mainxlsCreate() {
	file := xlsx.NewFile()
	sheet,_:= file.AddSheet("Sheet1")
	row := sheet.AddRow()
	row.SetHeightCM(1) //设置每行的高度
	cell := row.AddCell()
	cell.Value = "CityCode"
	cell = row.AddCell()
	cell.Value = "DataTime"
	cell = row.AddCell()
	cell.Value = "Applianceid"
	cell = row.AddCell()
	cell.Value = "Flow"
	cell = row.AddCell()
	cell.Value = "Outtemp"
	cell = row.AddCell()
	cell.Value = "Settemp"
	cell = row.AddCell()
	cell.Value = "NewTempScore"
	cell = row.AddCell()
	cell.Value = "TempScore"
	cell = row.AddCell()
	cell.Value = "TempPattern"
	cell = row.AddCell()
	cell.Value = "WaterPattern"


	err := file.Save("tempScore.xlsx")
	if err != nil {
		panic(err)
	}
}
func mainxlsUpdate() {
	file, err := xlsx.OpenFile("tempScore.xlsx")
	if err != nil {
		panic(err)
	}
	first := file.Sheets[0]
	row := first.AddRow()
	row.SetHeightCM(1)
	cell := row.AddCell()
	cell.Value = "1"
	cell = row.AddCell()
	cell.Value = "张三"
	cell = row.AddCell()
	cell.Value = "男"
	cell = row.AddCell()
	cell.Value = "18"

	err = file.Save("tempScore.xlsx")
	if err != nil {
		panic(err)
	}

}
